export type FirstChar<T extends string> = T extends `${infer L}${infer R}` ? L : never;

// 特点就是不停的取右边的部分,取出第一个，而且每次取之前保存上一个
export type LastChar<T,F = never> = T extends `${infer L}${infer R}` ? LastChar<R, L> : F;

type A = FirstChar<"BEF">;
type B = FirstChar<"dev">;
type C = FirstChar<"">;
type D = FirstChar<"A">;
type E = LastChar<"BEF">;

export {}